package com.xszx.knowledge.entity;

import com.baomidou.mybatisplus.annotation.TableField;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
/**
 * <p>
 * 用户
 * </p>
 *
 * @author wencai
 * @since 2023/04/25 21:00
 */
public class User implements Serializable {

    private static final long serialVersionUID = 1L;


    private Long id;


    @TableField("login_name")
    @NotEmpty(message = "【用户名】不能为空")
    @Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{1,8}$", message = "【用户名】至少包含数字和英文")
    private String loginName;

    @NotEmpty(message = "【昵称】不能为空")
    private String name;
    @NotEmpty(message = "【密码】不能为空")
    @Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,32}$", message = "【密码】至少包含 数字和英文，长度6-32")
    private String password;

    public User() {
    }

    public User(String loginName) {
        this.loginName = loginName;
    }

    public User(Long id,String password) {
        this.id = id;
        this.password = password;
    }
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
